﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Commands;
using Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Tests.Integration.Instruments;
using Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Views;

namespace Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Tests.Integration.Commands
{
    [TestClass]
    public class ShowCodeMetricsCalculationResultCommandTest : FxCopIntegratorTestAutomaterBase
    {
        [TestInitialize]
        public void SetUp()
        {
            RunOnUIThread(CloseAllWindows);
        }

        [TestCleanup]
        public void TearDown()
        {
            RunOnUIThread(CloseAllWindows);
        }

        [TestMethod]
        [HostType("VS IDE")]
        public void ExecuteShouldShowCodeMetricsCalculationResultWindowPane()
        {
            RunOnUIThread(() =>
            {
                Assert.WindowPaneDoesNotExist<CodeInspectionResultWindowPane>();
                Assert.WindowPaneDoesNotExist<CodeMetricsCalculationResultWindowPane>();

                ExecuteCommand<ShowCodeMetricsCalculationResultCommand>();

                Assert.WindowPaneDoesNotExist<CodeInspectionResultWindowPane>();
                Assert.WindowPaneExists<CodeMetricsCalculationResultWindowPane>();
            });
        }
    }
}
